﻿@using System.Globalization
@using BookShop.Library.Common
@using HTN.Library
@model BookShop.DTO.Book

<div class="product-item">
    <div class="pi-img-wrapper">
        <img src="@Utility.UrlCombine(CommonFunction.GetConfigValue("SiteUrl"), Model.PictureUrl)" class="img-responsive" alt="@Model.Title">
        <div>
            <a href="@Utility.UrlCombine(CommonFunction.GetConfigValue("SiteUrl"), Model.PictureUrl)" class="btn btn-default fancybox-button">Zoom</a>
            @*<a href="#product-pop-up" class="btn btn-default fancybox-fast-view">Xem nhanh</a>*@
        </div>
    </div>
    <h3><a href="@Url.Action("Detail", "Book", new { bookId = Model.Id })">@Model.Title</a></h3>
    <div class="pi-price my-price">
        @if (Model.IsOnSale)
        {
            @Model.DiscountPrice.ToString(CultureInfo.CreateSpecificCulture("en-US"))@("Đ")
            <em><span>@Model.Price.ToString(CultureInfo.CreateSpecificCulture("en-US"))</span>(Đ)</em>
        }
        else
        {
            @Model.Price.ToString(CultureInfo.CreateSpecificCulture("en-US"))@("Đ")
        }
    </div>
    <a href="javascript:addCartItem('1','@Model.Id');" class="btn btn-default add2cart">Giỏ hàng</a>
    @if (Model.IsNew)
    {
        <div class="sticker sticker-new"></div>
    }
    @if (Model.IsOnSale)
    {
        <div class="sticker sticker-sale"></div>
    }
</div>
